/*
 * =====================================================================================
 *
 *       Filename:  cl_mutex.hxx
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  10/08/2010 09:18:19 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Ken Chen (Ziliang), zlchen.ken@gmail.com
 *        Company:  EMC
 *
 * =====================================================================================
 */

#ifndef _CL_MUTEX_HXX_
#define _CL_MUTEX_HXX_

#include <pthread.h>
#include "cl_lock.hxx"

namespace neo
{
class CLMutex: public CLLock
{
public:
	CLMutex();
	~CLMutex();

private:
	int doLock(void);
	int doTryLock(void);
	int doUnLock(void);

private:
	CLMutex(const CLMutex&);
	CLMutex& operator=(const CLMutex&);

protected:
  pthread_mutex_t* getMutex(void);

private:
	pthread_mutex_t m_mutex;
	pthread_mutexattr_t m_mutexAttr;
};

} // neo

#endif //_CL_MUTEX_HXX_

